package com.ygqh.baby.mapper;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.BargainProductListModel;
import com.ygqh.baby.model.ProductBargainData;
import com.ygqh.baby.po.YgBargain;
import com.ygqh.baby.po.YgBargainExample;
import com.ygqh.baby.po.YgProduct;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface YgBargainMapper {
    int countByExample(YgBargainExample example);

    int deleteByExample(YgBargainExample example);

    int deleteByPrimaryKey(Long id);

    int insert(YgBargain record);

    int insertSelective(YgBargain record);

    List<YgBargain> selectByExample(YgBargainExample example);

    YgBargain selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") YgBargain record, @Param("example") YgBargainExample example);

    int updateByExample(@Param("record") YgBargain record, @Param("example") YgBargainExample example);

    int updateByPrimaryKeySelective(YgBargain record);

    int updateByPrimaryKey(YgBargain record);

    int countSuper(@Param("q") String q, @Param("jobStatus") String jobStatus, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<YgBargain> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("q") String q, @Param("jobStatus") String jobStatus,
                                @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<YgProduct> selectProductForBargain(@Param("queryInfo") QueryInfo queryInfo, @Param("productName") String productName, @Param("groupId") Long groupId,
                                            @Param("bargainId") Long bargainId);

    Boolean existBargain(@Param("productId") Long productId, @Param("bargainId") Long bargainId);

    YgBargain selectBargainByProductId(@Param("productId") Long productId, @Param("platformNos") String[] platformNos);

    List<YgBargain> findBargainList(@Param("pStatus") String pStatus, @Param("currentDate") Date currentDate, @Param("platformNos") String[] platformNos);

    List<BargainProductListModel> selectBargainProductList(@Param("queryInfo") QueryInfo queryInfo,
                                                           @Param("bargainId") Long bargainId,
                                                           @Param("currentDate") Date currentDate,
                                                           @Param("platformNos") String[] platformNos);

    ProductBargainData selectProductBargainData(@Param("productId") Long productId, @Param("bargainId") Long bargainId, @Param("platformNos") String[] platformNos);

    ProductBargainData selectProductBargainDataByUserBargainId(@Param("userBargainId") Long userBargainId);

}
